<script setup>
import { useRouter } from 'vue-router'

const router = useRouter()

import { useStore } from 'vuex'
const store = useStore()
console.log(store, 55);

/* this.$store.state.money    this.$store=store */
const btn = () => {
  // router.push('/login')
  router.push({ name: 'login', params: { gender: '男' }, query: { id: 1, name: 'jack' } })
}

/* vuex */
const btn2 = () => {
  store.commit('double')
}
</script>
<template>
  <div>

    <!-- 
    this.$route  ===获取参数
    this.$router.push=====实现跳转



   -->
    御剑乘风来,除魔天地间!===vue3=======
    <router-link to="/home/rose/123?age=18">首页</router-link>=====
    <!-- <router-link to="/login">登录</router-link> -->
    <button @click="btn">登录</button>
    <button @click="btn2">vuex===={{ store.state.money }}</button>
    <router-view></router-view>
  </div>
</template>
<style lang='less'  scoped>
</style>